#include <iostream>
#include <vector>
#include <fstream>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;


void euler_path(vector< set<int> >& g)
{
    int n =g.size();
    int start = -1;
    for (int i = 0; i<n; ++i)
    {
        if (!g[i].empty())
        {
            start = i;
            break;
        }
    }
    if (start == -1)
    {
        cout<<"NO";
        return;
    }
    stack<int> st;
    st.push(start);
    vector<int> res;
    while (!st.empty())
    {
        int v = st.top();
        if (g[v].size() == 0)
        {
            st.pop();
            res.push_back(v);
        }
        else
        {
            int to = *(g[v].begin());
            g[v].erase(g[v].begin());
            g[to].erase(v);
            st.push(to);
        }
    }
    for (int i = 0; i<n; ++i)
    {
        if (!g[i].empty())
        {
            cout<<"NO";
            return;
        }
    }
    reverse(res.begin(), res.end());
    cout<<"YES\n";
    for (int i = 0; i<res.size(); ++i)
    {
        cout<<res[i]<<' ';
    }
}

int main()
{
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    vector< set<int> > g;
    int n;
    cin>>n;
    g.resize(n);
    int from, to;
    while (cin>>from>>to)
    {
        g[from].insert(to);
        g[to].insert(from);
    }
    for (int i = 0; i<n; ++i)
    {
        if (g[i].size()%2 == 1)
        {
            cout<<"NO";
            return 0;
        }
    }
    euler_path(g);
    return 0;
}
